﻿package fui.utils{
	import flash.events.*;
	import flash.display.Sprite;
	import fl.controls.*;
	import fl.containers.ScrollPane;
	import flash.text.TextFormat;
	
	import fui.utils.calendar.*;
	
	public class FUICalendar extends Sprite{
		private var _currDate:Date = new Date();
		private var _type:int;
		private var _month:Array = new Array();
		private var _mon_len:int;
		public function FUICalendar(type:int){
			this._type = type;
			var mon:Number = _currDate.getMonth();
			var day:Number = _currDate.getDay();
			trace ("Mon:" + mon +", Day:" + day);
			switch (mon){
				case 0:
				case 2:
				case 4:
					_mon_len = 31;
				break;
				case 1:
					_mon_len = 28;
				break;
			}
			trace ("Month len:" + _mon_len);
			var i:int = 1;
			var week_counter:int = 1;
			for(i = 1; i<= _mon_len; i++)
			{
				
				_month[i] = new CDay(i, i* 40, week_counter * 40);
				trace("o:" +i%7);
				if (i%7 == 0)
				{
					week_counter += 1;
				}
				addChild(_month[i]);
			}
		}
	}
}